package k;

import com.oreilly.servlet.multipart.FileRenamePolicy;

import java.io.File;

/**
 * Created by kzhou on 2015/4/30.
 */
public class MyCOSFileRenamePolicy implements FileRenamePolicy {
    @Override
    public File rename(File file) {
        String fileExt = HelperClazz.getFileExt(file.getName());
        return fileExt!=null ? new File(file.getParent(),HelperClazz.getRandomName() +"."+ fileExt) : new File(file.getParent(),HelperClazz.getRandomName());
    }
}
